package xyz.xymu.oreo.testwindowmanager

import android.app.Service
import android.content.Context
import android.graphics.PixelFormat
import android.os.Build
import android.view.Gravity
import android.view.WindowManager

/**
 *
 * User: Tom
 * Date: 2023/12/20 21:51
 */
class Land(context: Context) {

    private val wm: WindowManager =
        context.getSystemService(Service.WINDOW_SERVICE) as WindowManager

    private var lp: WindowManager.LayoutParams = WindowManager.LayoutParams()

    init {
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
            lp.type = WindowManager.LayoutParams.TYPE_APPLICATION_OVERLAY
        } else {
            lp.type = WindowManager.LayoutParams.TYPE_SYSTEM_OVERLAY
        }
        lp.flags =
            WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE or WindowManager.LayoutParams.FLAG_NOT_TOUCH_MODAL
        lp.format = PixelFormat.TRANSPARENT
        lp.width = WindowManager.LayoutParams.WRAP_CONTENT
        lp.height = WindowManager.LayoutParams.WRAP_CONTENT
        lp.gravity = Gravity.TOP or Gravity.START


    }

    private fun createLandLayout(){

    }

}